/* eslint-disable no-console */
/* eslint-disable import/prefer-default-export */
import 'reflect-metadata';
import './assets';
import '@vant/touch-emulator';

import { createApp } from 'vue';

import initRouter from '@/router';
import initVconsole from '@/utils/vconsole';

import App from './App.vue';
import plugins from './plugins';
import store from './stores';
import useModeStore, { ModeEnum } from './stores/mode.store';

(async () => {
  const app = createApp(App);
  app.use(store);

  if (useModeStore().current === ModeEnum.DEV) {
    initVconsole();
  }
  const router = initRouter();
  app.use(router);
  app.use(plugins);
  await router.isReady();

  app.mount('#app');
  console.log(import.meta.env);
})();
